package me.zhengjie.modules.zhaojiu.domain.enumeration;

public enum  CheckInStatus {
    UNCALL("待点名", 0),
    ABSENT("旷课", 1),
    LEAVE("请假", 2),
    CHECKIN("正常", 3);

    private String name;
    private int index;

    //构造方法
    private CheckInStatus(String name, int index){
        this.name = name;
        this.index = index;
    }

    //类的方法
    public static String getName(int index){
        for(CheckInStatus cis : CheckInStatus.values()){
            if(cis.getIndex() == index){
                return cis.name;
            }
        }
        return null;
    }

    public String getName(){
        return name;
    }

    public void setName(String name){
        this.name = name;
    }

    public int getIndex(){
        return index;
    }

    public void setIndex(int index){
        this.index = index;
    }

    @Override
    public String toString(){
        return this.index + "_" + this.name;
    }
}
